]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
location: Update available accuracy on max accuracy changing
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Tue, 10 Jun 2014 00:24:10 +0000 (01:24 +0100)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Fri, 20 Jun 2014 11:26:27 +0000 (12:26 +0100)
We translate 'On' to available accuracy level but if available accuracy
level later changes, we don't update available accuracy level accordingly
and hence limit the accuracy of apps.

E.g if available accuracy level is 'city' and geolocation is enabled,
the max accuracy level would be 'city' and apps can't get higher than
that. Now if user plugs in GPS, the available accuracy level will change
to 'exact' but without this patch max accuracy level will remain to be
'city' and apps will not be able to use the GPS.

https://bugzilla.gnome.org/show_bug.cgi?id=731882

js/ui/status/location.js

index 8ae76330b019f3b898658ed8e1f30916ffeeabac..581a53440206234202f2e2274a6d09de6b052ef5 100644 (file)
@@ -191,8 +191,12 @@ const Indicator = new Lang.Class({
         let unpacked = properties.deep_unpack();
         if ("InUse" in unpacked)
             this._syncIndicator();
-        if ("AvailableAccuracyLevel" in unpacked)
+        if ("AvailableAccuracyLevel" in unpacked) {
             this._availableAccuracyLevel = this._proxy.AvailableAccuracyLevel;
+
+            if (this._getMaxAccuracyLevel() != 0)
+                this._settings.set_enum(MAX_ACCURACY_LEVEL, this._availableAccuracyLevel);
+        }
     }
 });